package com.ymatou.iapi.csim.service;

import net.sf.json.JSONObject;

import com.ymatou.iapi.coupon.parameter.batchInfos;
import com.ymatou.iapi.csim.parameter.GetCsMessageListResp;
import com.ymatou.iapi.csim.parameter.GetUserMessageListResp;
import com.ymatou.iapi.csim.parameter.SendMessageToCSResp;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.utils.DataUtil;
import com.ymttest.utils.EnvSetup;
/**
*获取消息列表Call
*FreeMaker Template自动生成代码
*/
public class GetMessageListCall extends YmatouBaseCall{
	private static String opurl ="api/user/GetMessageList";
	
	public GetMessageListCall() {
		super(EnvSetup.getSystemUrl("csim_iapi"),opurl,"GET","PARAM");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
	//	client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	
    @SuppressWarnings("deprecation")
	public GetUserMessageListResp getData()
    {
    	GetUserMessageListResp data = null;
        try {
            //data = (GetUserMessageListResp) FormatUtil.JSONToObject(DataUtil.Json.parseJsonObj(getString("Result")).toString(), GetUserMessageListResp.class);
            
         //   FormatUtil.GSONToObject(DataUtil.Json.parseJsonObj(getData()).toString() ,GetUserMessageListResp.class);
         //data=(GetUserMessageListResp) JSONObject.toBean(DataUtil.Json.parseJsonObj(getString("Result")), GetUserMessageListResp.class);
         data = (GetUserMessageListResp) FormatUtil.GSONToObject(DataUtil.Json.parseJsonObj(getString("Result")).toString(), GetUserMessageListResp.class);
           
            
            
        } catch (Exception e) {
            e.printStackTrace();
        }
        return data;
    }
}